// 定义接口
export interface PictureReviewStatus {
  status: number
  desc: string
}

// 定义常量
export const REVIEWING: PictureReviewStatus = { status: 0, desc: '待审核' }
export const PASS: PictureReviewStatus = { status: 1, desc: '审核通过' }
export const REJECT: PictureReviewStatus = { status: 2, desc: '审核拒绝' }

// 将所有状态放入一个数组，方便遍历或查找
export const PictureReviewStatuses: PictureReviewStatus[] = [REVIEWING, PASS, REJECT]

// 辅助函数：根据状态码获取对应的对象
export function getReviewStatusByCode(code: number): PictureReviewStatus | undefined {
  return PictureReviewStatuses.find((status) => status.status === code)
}

export const PICTURE_REVIEW_STATUS_OPTIONS = [REVIEWING, PASS, REJECT].map((key) => {
  return {
    label: key.desc,
    value: key.status,
  }
})
